﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PagedList<CourseSystem.Core.Entities.ForumsInfo>>" %>
<%@ Import Namespace="CourseSystem.Common.Helpers" %>
<%@ Import Namespace="CourseSystem.Core.Enum" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc" %>
<table width="50%" height="2" border="0" align="center" cellpadding="0" cellspacing="0"
    bordercolor="#FFFFFF">
    <tr>
        <td bgcolor="#FFFFFF">
        </td>
    </tr>
</table>
<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
   <tr>
                <td width="426" height="25" bgcolor="#D1E5F0"><div align="center" class="style13">主题</div></td>
                <td width="194" bgcolor="#D1E5F0"><div align="center"><span class="style5">贴数</span></div></td>
                <td width="130" bgcolor="#D1E5F0"><div align="center"><span class="style13">贴数+回帖</span></div></td>
                <td width="184" bgcolor="#D1E5F0"><div align="center"><span class="style13">最后发表</span></div></td>
                </tr>
    <% int i = 1;

       foreach (var item in Model)
       {
           ForumsHelper.CheckTodayCount(item);
           var icon = item.TodayPostCount == 0 ? 2 : 1; %>
    <tr class="style1">
                <td height="35"><table width="417" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="8">&nbsp;</td>
                      <td width="21"><img src="<%=ResolveUrl("~/Content/images/"+icon+".jpg") %>" width="21" height="26"/></td>
                      <td width="13">&nbsp;</td>
                      <td width="375"><div align="left"><span class="style15"><%=Html.ActionLink(item.Name, "Topics", new { item.Id,isDigest=ViewData["isDigest"]})%></span>（今日：<%=item.TodayPostCount %>） </div></td>
                    </tr>
                  </table></td>
                <td><div align="center" class="style16"><%=item.TopicCount %></div></td>
                <td><div align="center" class="style16"><%=item.PostCount %></div></td>
                <td><div align="center" class="style16"> <%=item.LastPosterName %> </div></td>
                </tr>
    <% } %>
</table>
<table width="98%" height="7" border="0" align="center" cellpadding="0" cellspacing="0"
    bordercolor="#FFFFFF">
    <tr>
        <td class="gray12">
            &nbsp;
        </td>
        <td align="right" class="gray12">
            <%=Html.AjaxPager(Model, new PagerOptions() { ContainerTagName = "span", CssClass = "mvcPager", PageIndexParameterName = "pid", ShowMorePagerItems = false, AlwaysShowFirstLastPageNumber = true, }, new AjaxOptions() { UpdateTargetId = "listDiv" })%>
            共<%=Model.TotalItemCount %>条记录，页<%=Model.CurrentPageIndex %>/<%=Model.TotalPageCount %>
        </td>
    </tr>
</table>
